/************************************************************************
  * Copyright(c) 2023 Levetop Semiconductor Co.,Led. All rights reserved.
  * @file     iic.h
  * @author   UartTFT Application Team
  * @version  V0.0.1
  * @date     2023-01-01
  * @brief    
 *************************************************************************/

#ifndef _IIC_H
#define _IIC_H

#include "data.h"

//#include "sys.h"
//#include "i2c_drv.h"
//#include "eport_drv.h"
//#include "spi_drv.h"

extern uint8_t IIC_Buf[128];
extern uint32_t k, len, u32Tmp;
extern uint8_t tmpID, tmpEvent;
extern uint32_t u16Tmp, tmpX, tmpY;
extern uint16_t tpX[10], tpY[10];
extern uint32_t TPmaxX, TPmaxY;
extern uint8_t tpActive;

extern void i2c_sda_output(void);
extern void i2c_sda_input(void);
extern void i2c_set_scl(uint8_t index);
extern void i2c_set_sda(uint8_t index);
extern uint8_t i2c_get_sda(void);
extern void i2c_start(void);
extern void i2c_stop(void);
extern uint8_t i2c_write(uint8_t value);
extern uint8_t i2c_read(uint8_t ack);

#if (UARTBUS_OPTION == 3)
extern uint8_t flag_IIC_REG[];
extern uint16_t ID_IIC_WAV;

void I2C_Slave_TEST(uint8_t sla_addr);
void I2C1_IRQHandler(void);
#endif

#endif /* _IIC_H */
